package com.hetao.xx.activity;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.hetao.xx.Global;
import com.hetao.xx.R;
import com.hetao.xx.adapter.MessageAdapter;
import com.hetao.xx.game.FightUser;
import com.hetao.xx.game.model.User;
import com.hetao.xx.service.FightManager;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;


/**
 * @author hetao
 */
public class FightActivity extends AppCompatActivity {


    @SuppressLint("NonConstantResourceId")
    @BindView(R.id.fight_message_list)
    ListView listView;

    Global global = Global.getInstant();
    FightManager fightManager = global.fightManager;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fight);
        ButterKnife.bind(this);

        boolean isWin = fightManager.fightNpc();
        List<String> fightMsg = fightManager.getMessage();

        MessageAdapter messageAdapter = new MessageAdapter(this, R.layout.widget_msg_list_item, fightMsg);
        listView.setAdapter(messageAdapter);

    }


    @SuppressLint("NonConstantResourceId")
    @OnClick(R.id.fight_back)
    public void onClick(View v) {
        finish();
    }

}
